package com.os.opencv.java.chapter6;

import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.Size;
import org.opencv.highgui.HighGui;
import org.opencv.imgcodecs.Imgcodecs;
import org.opencv.imgproc.Imgproc;

public class GaussianBlur {

    public static void main(String[] args) {
        System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
        //读取图像并在屏幕上显示
        Mat src = Imgcodecs.imread("/Users/matt/Pictures/111.jpg");
        HighGui.imshow("src", src);
        HighGui.waitKey(0);

        //对图像进行高斯滤波5*5并在屏幕上显示
        Mat dst = new Mat();
        Imgproc.GaussianBlur(src, dst, new Size(5,5), 10,10);
        HighGui.imshow("gaussian 5*5", dst);
        HighGui.waitKey(0);

        //对图像进行高斯滤波7*7并在屏幕上显示
        Imgproc.GaussianBlur(src, dst, new Size(7,7), 10, 10);
        HighGui.imshow("gaussian 7*7", dst);
        HighGui.waitKey(0);

        //对图像进行高斯滤波11*11并在屏幕上显示
        Imgproc.GaussianBlur(src, dst, new Size(11,11), 10, 10);
        HighGui.imshow("gaussian 11*11", dst);
        HighGui.waitKey(0);

        System.exit(0);
    }

}
